import request from '@/utils/request'

export default{

    // 1. 课程添加信息
    addCourseInfo(courseInfo){
        return request({
            url: `/eduservice/edu-course/addCourseInfo`,
            method: 'post',
            data: courseInfo
          })
    },

    // 2.查询所有的讲师用于课程的显示
    getListTeacher(){
        return request({
            url: `/eduservice/edu-teacher/findAll`,
            method: 'get',
          })
    },
    // 根据课程id 查询课程基本信息
    getCourseInfoId(courseId){
        return request({
            url: `/eduservice/edu-course/getCourseInfo/${courseId}`,
            method: 'get',
          })
    },
    // 修改课程信息
    updateCourseInfo(courseInfo){
        return request({
            url: `/eduservice/edu-course/updateCourseInfo`,
            method: 'post',
            data: courseInfo
          })
    },

    // 课程信息确认显示
    getPublishCourseInfo(id){
        return request({
            url: `/eduservice/edu-course/getPublishCourseInfo/${id}`,
            method: 'get',
          })
    },

    // 课程的最终发布
    publicCourse(id){
        return request({
            url: `/eduservice/edu-course/publishCourse/${id}`,
            method: 'post',
          })
    },

    // 课程列表
    getListCourse(current,limit,courseQuery){
        return request({
            url: `/eduservice/edu-course/pageCourseCondition/${current}/${limit}`,
            method: 'post',
            data: courseQuery
          })
    },

    // 删除课程
    removeCourse(courseId){
        return request({
            url: `/eduservice/edu-course/${courseId}`,
            method: 'delete',
          })
    },
}

